package com.cake.entity;

import java.math.BigDecimal;
import java.util.Date;

import com.cake.base.config.OrderState;
import com.cake.entity.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.github.pagehelper.StringUtil;

public class XxOrder extends BaseEntity {
    /**
     * 订单主键
     * 表字段 : xx_order.id
     */
    private Long id;

    /**
     * 订单编号
     * 表字段 : xx_order.sn
     */
    private String sn;

    /**
     * 订单业务状态(0-待支付(统一) ，自营配送时：1已支付，2配送中，5待评价，6已完成；快递配送时：1已支付，3待发货，4已发货，5待评价，6已完成，7已取消)
     * 表字段 : xx_order.order_status
     */
    private Integer orderStatus;

    /**
     * 订单支付创建
     * 表字段 : xx_order.payment_status
     */
    private Integer paymentStatus;

    /**
     * 订单配送状态
     * 表字段 : xx_order.shipping_status
     */
    private Integer shippingStatus;

    /**
     * 订单所涉及的支付手续费
     * 表字段 : xx_order.fee
     */
    private BigDecimal fee;

    /**
     * 订单打包手续费
     * 表字段 : xx_order.packcharges
     */
    private BigDecimal packcharges;

    /**
     * 订单运费金额
     * 表字段 : xx_order.freight
     */
    private BigDecimal freight;

    /**
     * 促销折扣金额
     * 表字段 : xx_order.promotion_discount
     */
    private BigDecimal promotionDiscount;

    /**
     * 优惠券码主键
     * 表字段 : xx_order.coupon_code
     */
    private Long couponCode;

    /**
     * 优惠券抵扣金额
     * 表字段 : xx_order.coupon_discount
     */
    private BigDecimal couponDiscount;

    /**
     * 订单调整金额
     * 表字段 : xx_order.offset_amount
     */
    private BigDecimal offsetAmount;

    /**
     * 订单已支付金额
     * 表字段 : xx_order.amount_paid
     */
    private BigDecimal amountPaid;

    /**
     * 订单赠送积分
     * 表字段 : xx_order.point
     */
    private Integer point;

    /**
     * 订单消费积分
     * 表字段 : xx_order.shoping_point
     */
    private Long shopingPoint;

    /**
     * 收货人地区主键
     * 表字段 : xx_order.area
     */
    private Long area;

    /**
     * 收货人名称
     * 表字段 : xx_order.consignee
     */
    private String consignee;

    /**
     * 收货人地区名称
     * 表字段 : xx_order.area_name
     */
    private String areaName;

    /**
     * 收货人地区地址
     * 表字段 : xx_order.address
     */
    private String address;

    /**
     * 是否使用了余额支付
     * 表字段 : xx_order.is_usedbalance
     */
    private Boolean isUsedbalance;

    /**
     * 收货人邮编地址
     * 表字段 : xx_order.zip_code
     */
    private String zipCode;

    /**
     * 下单会员主键
     * 表字段 : xx_order.member
     */
    private Long member;

    /**
     * 下单会员微信id
     * 表字段 : xx_order.member_wx_id
     */
    private String memberWxId;

    /**
     * 收货人电话
     * 表字段 : xx_order.phone
     */
    private String phone;

    /**
     * 是否开具发票
     * 表字段 : xx_order.is_invoice
     */
    private Boolean isInvoice;

    /**
     * 发票抬头
     * 表字段 : xx_order.invoice_title
     */
    private String invoiceTitle;

    /**
     * 订单涉及交税金额
     * 表字段 : xx_order.tax
     */
    private BigDecimal tax;

    /**
     * 订单备注附言
     * 表字段 : xx_order.memo
     */
    private String memo;

    /**
     * 促销名称
     * 表字段 : xx_order.promotion
     */
    private String promotion;

    /**
     * 订单支付超时时间
     * 表字段 : xx_order.expire
     */
    private Date expire;

    /**
     * 订单锁定到期时间
     * 表字段 : xx_order.lock_expire
     */
    private Date lockExpire;

    /**
     * 订单的预定配送时间
     * 表字段 : xx_order.book_time
     */
    private Date bookTime;

    /**
     * 是否已分配库存
     * 表字段 : xx_order.is_allocated_stock
     */
    private Boolean isAllocatedStock;

    /**
     * 支付方式主键
     * 表字段 : xx_order.payment_method
     */
    private Long paymentMethod;

    /**
     * 支付方式名称
     * 表字段 : xx_order.payment_method_name
     */
    private String paymentMethodName;

    /**
     * 配送方式主键
     * 表字段 : xx_order.shipping_method
     */
    private Long shippingMethod;

    /**
     * 配送方式名称
     * 表字段 : xx_order.shipping_method_name
     */
    private String shippingMethodName;

    /**
     * 订单提取商品码
     * 表字段 : xx_order.fetch_code
     */
    private String fetchCode;

    /**
     * 订单闪送人员名称
     * 表字段 : xx_order.flash_men
     */
    private String flashMen;

    /**
     * 订单闪送人员电话
     * 表字段 : xx_order.flash_men_phone
     */
    private String flashMenPhone;

    /**
     * 后台操作人主键
     * 表字段 : xx_order.operator
     */
    private Long operator;

    /**
     * 后台上门联系人员主键
     * 表字段 : xx_order.admin
     */
    private Long admin;

    /**
     * 后台配送人员主键
     * 表字段 : xx_order.poster
     */
    private Long poster;

    /**
     * 客户回复星级
     * 表字段 : xx_order.replycontent
     */
    private String replycontent;

    /**
     * 客户回复时间
     * 表字段 : xx_order.replydata
     */
    private String replydata;

    /**
     * 订单所属商店主键
     * 表字段 : xx_order.shop
     */
    private Long shop;

    /**
     * 收件地址id
     * 表字段 : xx_order.receive_id
     */
    private Long receiveId;

    /**
     * 外部订单号
     * 表字段 : xx_order.sn_out
     */
    private String snOut;

    /**
     * 订单商品数量总计
     * 表字段 : xx_order.total_quality
     */
    private Integer totalQuality;

    /**
     * 订单总金额
     * 表字段 : xx_order.total_amount
     */
    private BigDecimal totalAmount;

    /**
     * 配送时间(日期+时间段)
     * 表字段 : xx_order.send_time
     */
    private String sendTime;

    /**
     * 配送截止时间(格式为 HH：mm)
     * 表字段 : xx_order.send_end_time
     */
    private String sendEndTime;

    /**
     * 快递员接单确定时间
     * 表字段 : xx_order.worker_confirmed_time
     */
    private Date workerConfirmedTime;

    /**
     * 快递员完成配送时间
     * 表字段 : xx_order.worker_received_time
     */
    private Date workerReceivedTime;

    /**
     * 派送员配送开始时间
     * 表字段 : xx_order.worker_sending_time
     */
    private Date workerSendingTime;

    /**
     * 配送员完成配送时间
     * 表字段 : xx_order.worker_finish_time
     */
    private Date workerFinishTime;

    /**
     * 客户上门自取时间
     * 表字段 : xx_order.taking_finish_time
     */
    private Date takingFinishTime;

    /**
     * 订单备注
     * 表字段 : xx_order.intro
     */
    private String intro;

    /**
     * 订单创建时间
     * 表字段 : xx_order.create_date
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createDate;

    /**
     * 订单最新修改时间
     * 表字段 : xx_order.modify_date
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date modifyDate;

    /**
     * 
     * 表字段 : xx_order.discount
     */
    private BigDecimal discount;

    /**
     * 
     * 表字段 : xx_order.sendup
     */
    private BigDecimal sendup;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table xx_order
     *
     * @mbg.generated
     */
    private static final long serialVersionUID = 1L;

    /**
     * 下单人名称
     */
    private String memberName;
    
    /**
     * 送货人名称
     */
    private String adminName;
    /**
     *	送货人电话
     */
    private String adminPhone;
    
    public String getMemberName() {
		return memberName;
	}

	public void setMemberName(String memberName) {
		this.memberName = memberName;
	}

	public String getAdminName() {
		return StringUtil.isEmpty(adminName) ? "" : adminName;
	}

	public void setAdminName(String adminName) {
		this.adminName = adminName;
	}

	public String getAdminPhone() {
		return StringUtil.isEmpty(adminPhone) ? "" : adminPhone;
	}

	public void setAdminPhone(String adminPhone) {
		this.adminPhone = adminPhone;
	}

	public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn == null ? null : sn.trim();
    }

    public Integer getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(Integer orderStatus) {
        this.orderStatus = orderStatus;
    }

    public Integer getPaymentStatus() {
        return paymentStatus;
    }

    public void setPaymentStatus(Integer paymentStatus) {
        this.paymentStatus = paymentStatus;
    }

    public Integer getShippingStatus() {
        return shippingStatus;
    }

    public void setShippingStatus(Integer shippingStatus) {
        this.shippingStatus = shippingStatus;
    }

    public BigDecimal getFee() {
        return fee;
    }

    public void setFee(BigDecimal fee) {
        this.fee = fee;
    }

    public BigDecimal getPackcharges() {
        return packcharges;
    }

    public void setPackcharges(BigDecimal packcharges) {
        this.packcharges = packcharges;
    }

    public BigDecimal getFreight() {
        return freight;
    }

    public void setFreight(BigDecimal freight) {
        this.freight = freight;
    }

    public BigDecimal getPromotionDiscount() {
        return promotionDiscount;
    }

    public void setPromotionDiscount(BigDecimal promotionDiscount) {
        this.promotionDiscount = promotionDiscount;
    }

    public Long getCouponCode() {
        return couponCode;
    }

    public void setCouponCode(Long couponCode) {
        this.couponCode = couponCode;
    }

    public BigDecimal getCouponDiscount() {
        return couponDiscount;
    }

    public void setCouponDiscount(BigDecimal couponDiscount) {
        this.couponDiscount = couponDiscount;
    }

    public BigDecimal getOffsetAmount() {
        return offsetAmount;
    }

    public void setOffsetAmount(BigDecimal offsetAmount) {
        this.offsetAmount = offsetAmount;
    }

    public BigDecimal getAmountPaid() {
        return amountPaid;
    }

    public void setAmountPaid(BigDecimal amountPaid) {
        this.amountPaid = amountPaid;
    }

    public Integer getPoint() {
        return point;
    }

    public void setPoint(Integer point) {
        this.point = point;
    }

    public Long getShopingPoint() {
        return shopingPoint;
    }

    public void setShopingPoint(Long shopingPoint) {
        this.shopingPoint = shopingPoint;
    }

    public Long getArea() {
        return area;
    }

    public void setArea(Long area) {
        this.area = area;
    }

    public String getConsignee() {
        return consignee;
    }

    public void setConsignee(String consignee) {
        this.consignee = consignee == null ? null : consignee.trim();
    }

    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName == null ? null : areaName.trim();
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address == null ? null : address.trim();
    }

    public Boolean getIsUsedbalance() {
        return isUsedbalance;
    }

    public void setIsUsedbalance(Boolean isUsedbalance) {
        this.isUsedbalance = isUsedbalance;
    }

    public String getZipCode() {
        return zipCode;
    }

    public void setZipCode(String zipCode) {
        this.zipCode = zipCode == null ? null : zipCode.trim();
    }

    public Long getMember() {
        return member;
    }

    public void setMember(Long member) {
        this.member = member;
    }

    public String getMemberWxId() {
        return memberWxId;
    }

    public void setMemberWxId(String memberWxId) {
        this.memberWxId = memberWxId == null ? null : memberWxId.trim();
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone == null ? null : phone.trim();
    }

    public Boolean getIsInvoice() {
        return isInvoice;
    }

    public void setIsInvoice(Boolean isInvoice) {
        this.isInvoice = isInvoice;
    }

    public String getInvoiceTitle() {
        return invoiceTitle;
    }

    public void setInvoiceTitle(String invoiceTitle) {
        this.invoiceTitle = invoiceTitle == null ? null : invoiceTitle.trim();
    }

    public BigDecimal getTax() {
        return tax;
    }

    public void setTax(BigDecimal tax) {
        this.tax = tax;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo == null ? null : memo.trim();
    }

    public String getPromotion() {
        return promotion;
    }

    public void setPromotion(String promotion) {
        this.promotion = promotion == null ? null : promotion.trim();
    }

    public Date getExpire() {
        return expire;
    }

    public void setExpire(Date expire) {
        this.expire = expire;
    }

    public Date getLockExpire() {
        return lockExpire;
    }

    public void setLockExpire(Date lockExpire) {
        this.lockExpire = lockExpire;
    }

    public Date getBookTime() {
        return bookTime;
    }

    public void setBookTime(Date bookTime) {
        this.bookTime = bookTime;
    }

    public Boolean getIsAllocatedStock() {
        return isAllocatedStock;
    }

    public void setIsAllocatedStock(Boolean isAllocatedStock) {
        this.isAllocatedStock = isAllocatedStock;
    }

    public Long getPaymentMethod() {
        return paymentMethod;
    }

    public void setPaymentMethod(Long paymentMethod) {
        this.paymentMethod = paymentMethod;
    }

    public String getPaymentMethodName() {
        return paymentMethodName;
    }

    public void setPaymentMethodName(String paymentMethodName) {
        this.paymentMethodName = paymentMethodName == null ? null : paymentMethodName.trim();
    }

    public Long getShippingMethod() {
        return shippingMethod;
    }

    public void setShippingMethod(Long shippingMethod) {
        this.shippingMethod = shippingMethod;
    }

    public String getShippingMethodName() {
        return shippingMethodName;
    }

    public void setShippingMethodName(String shippingMethodName) {
        this.shippingMethodName = shippingMethodName == null ? null : shippingMethodName.trim();
    }

    public String getFetchCode() {
        return fetchCode;
    }

    public void setFetchCode(String fetchCode) {
        this.fetchCode = fetchCode == null ? null : fetchCode.trim();
    }

    public String getFlashMen() {
        return flashMen;
    }

    public void setFlashMen(String flashMen) {
        this.flashMen = flashMen == null ? null : flashMen.trim();
    }

    public String getFlashMenPhone() {
        return flashMenPhone;
    }

    public void setFlashMenPhone(String flashMenPhone) {
        this.flashMenPhone = flashMenPhone == null ? null : flashMenPhone.trim();
    }

    public Long getOperator() {
        return operator;
    }

    public void setOperator(Long operator) {
        this.operator = operator;
    }

    public Long getAdmin() {
        return admin;
    }

    public void setAdmin(Long admin) {
        this.admin = admin;
    }

    public Long getPoster() {
        return poster;
    }

    public void setPoster(Long poster) {
        this.poster = poster;
    }

    public String getReplycontent() {
        return replycontent;
    }

    public void setReplycontent(String replycontent) {
        this.replycontent = replycontent == null ? null : replycontent.trim();
    }

    public String getReplydata() {
        return replydata;
    }

    public void setReplydata(String replydata) {
        this.replydata = replydata == null ? null : replydata.trim();
    }

    public Long getShop() {
        return shop;
    }

    public void setShop(Long shop) {
        this.shop = shop;
    }

    public Long getReceiveId() {
        return receiveId;
    }

    public void setReceiveId(Long receiveId) {
        this.receiveId = receiveId;
    }

    public String getSnOut() {
        return snOut;
    }

    public void setSnOut(String snOut) {
        this.snOut = snOut == null ? null : snOut.trim();
    }

    public Integer getTotalQuality() {
        return totalQuality;
    }

    public void setTotalQuality(Integer totalQuality) {
        this.totalQuality = totalQuality;
    }

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public String getSendTime() {
        return StringUtil.isEmpty(sendTime) ? "" : sendTime;
    }

    public void setSendTime(String sendTime) {
        this.sendTime = sendTime == null ? null : sendTime.trim();
    }

    public String getSendEndTime() {
        return sendEndTime;
    }

    public void setSendEndTime(String sendEndTime) {
        this.sendEndTime = sendEndTime == null ? null : sendEndTime.trim();
    }

    public Date getWorkerConfirmedTime() {
        return workerConfirmedTime;
    }

    public void setWorkerConfirmedTime(Date workerConfirmedTime) {
        this.workerConfirmedTime = workerConfirmedTime;
    }

    public Date getWorkerReceivedTime() {
        return workerReceivedTime;
    }

    public void setWorkerReceivedTime(Date workerReceivedTime) {
        this.workerReceivedTime = workerReceivedTime;
    }

    public Date getWorkerSendingTime() {
        return workerSendingTime;
    }

    public void setWorkerSendingTime(Date workerSendingTime) {
        this.workerSendingTime = workerSendingTime;
    }

    public Date getWorkerFinishTime() {
        return workerFinishTime;
    }

    public void setWorkerFinishTime(Date workerFinishTime) {
        this.workerFinishTime = workerFinishTime;
    }

    public Date getTakingFinishTime() {
        return takingFinishTime;
    }

    public void setTakingFinishTime(Date takingFinishTime) {
        this.takingFinishTime = takingFinishTime;
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro == null ? null : intro.trim();
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getModifyDate() {
        return modifyDate;
    }

    public void setModifyDate(Date modifyDate) {
        this.modifyDate = modifyDate;
    }

    public BigDecimal getDiscount() {
        return discount;
    }

    public void setDiscount(BigDecimal discount) {
        this.discount = discount;
    }

    public BigDecimal getSendup() {
        return sendup;
    }

    public void setSendup(BigDecimal sendup) {
        this.sendup = sendup;
    }

    public String getOrderStatusName(){
    	return OrderState.getName(this.orderStatus);
    }
    
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", sn=").append(sn);
        sb.append(", orderStatus=").append(orderStatus);
        sb.append(", paymentStatus=").append(paymentStatus);
        sb.append(", shippingStatus=").append(shippingStatus);
        sb.append(", fee=").append(fee);
        sb.append(", packcharges=").append(packcharges);
        sb.append(", freight=").append(freight);
        sb.append(", promotionDiscount=").append(promotionDiscount);
        sb.append(", couponCode=").append(couponCode);
        sb.append(", couponDiscount=").append(couponDiscount);
        sb.append(", offsetAmount=").append(offsetAmount);
        sb.append(", amountPaid=").append(amountPaid);
        sb.append(", point=").append(point);
        sb.append(", shopingPoint=").append(shopingPoint);
        sb.append(", area=").append(area);
        sb.append(", consignee=").append(consignee);
        sb.append(", areaName=").append(areaName);
        sb.append(", address=").append(address);
        sb.append(", isUsedbalance=").append(isUsedbalance);
        sb.append(", zipCode=").append(zipCode);
        sb.append(", member=").append(member);
        sb.append(", memberWxId=").append(memberWxId);
        sb.append(", phone=").append(phone);
        sb.append(", isInvoice=").append(isInvoice);
        sb.append(", invoiceTitle=").append(invoiceTitle);
        sb.append(", tax=").append(tax);
        sb.append(", memo=").append(memo);
        sb.append(", promotion=").append(promotion);
        sb.append(", expire=").append(expire);
        sb.append(", lockExpire=").append(lockExpire);
        sb.append(", bookTime=").append(bookTime);
        sb.append(", isAllocatedStock=").append(isAllocatedStock);
        sb.append(", paymentMethod=").append(paymentMethod);
        sb.append(", paymentMethodName=").append(paymentMethodName);
        sb.append(", shippingMethod=").append(shippingMethod);
        sb.append(", shippingMethodName=").append(shippingMethodName);
        sb.append(", fetchCode=").append(fetchCode);
        sb.append(", flashMen=").append(flashMen);
        sb.append(", flashMenPhone=").append(flashMenPhone);
        sb.append(", operator=").append(operator);
        sb.append(", admin=").append(admin);
        sb.append(", poster=").append(poster);
        sb.append(", replycontent=").append(replycontent);
        sb.append(", replydata=").append(replydata);
        sb.append(", shop=").append(shop);
        sb.append(", receiveId=").append(receiveId);
        sb.append(", snOut=").append(snOut);
        sb.append(", totalQuality=").append(totalQuality);
        sb.append(", totalAmount=").append(totalAmount);
        sb.append(", sendTime=").append(sendTime);
        sb.append(", sendEndTime=").append(sendEndTime);
        sb.append(", workerConfirmedTime=").append(workerConfirmedTime);
        sb.append(", workerReceivedTime=").append(workerReceivedTime);
        sb.append(", workerSendingTime=").append(workerSendingTime);
        sb.append(", workerFinishTime=").append(workerFinishTime);
        sb.append(", takingFinishTime=").append(takingFinishTime);
        sb.append(", intro=").append(intro);
        sb.append(", createDate=").append(createDate);
        sb.append(", modifyDate=").append(modifyDate);
        sb.append(", discount=").append(discount);
        sb.append(", sendup=").append(sendup);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}